import { defineStore } from "pinia"
import {  computed, ref } from "vue"

export const useCounterStore = defineStore("counter", () => {

  const totalCount = ref(0)
  
  const addTotalCount = (val:number) => {
    totalCount.value+=val
  }

  const doubleTotalCount = computed(() => {
    return totalCount.value*2
  })


  
  return {totalCount,addTotalCount,doubleTotalCount}
}, {persist:true})